<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <f:view contentType="text/html" encoding="utf-8">
      <h:head/>
<h:body>

<p:tabMenu activeIndex="2">
    		<p:menuitem value="HomePage" url="home.xhtml" icon="ui-icon-star"/>
    		<p:menuitem value="Registrati" url="register.xhtml" icon="ui-icon-wrench"/>
    		<p:menuitem value="RicercaPacchetto" url="search.xhtml" icon="ui-icon-search" />
    		<p:menuitem value="Spazio Utente" url="user/index.xhtml" icon="ui-icon-person" />
    		<p:menuitem value="Spazio Impiegato" url="employee/index.xhtml" icon="ui-icon-person" />
    	</p:tabMenu>
    <br/><br/>
<h:form id="form">
	<p:dataGrid var="packet" value="#{searchPktBean.packetList}" columns="3"
		rows="12" paginator="true"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
		rowsPerPageTemplate="9,12,15">

        <p:panel header="#{packet.destinazione}" style="text-align:center">
            <h:panelGrid columns="1" style="width:100%"> 

                <h:outputText value="#{packet.pid}" />

                <p:commandLink update=":form:packetDetail" oncomplete="PF('packetDialog').show()" title="View Detail">
                    <h:outputText styleClass="ui-icon ui-icon-search" style="margin:0 auto;" /> 
                    <f:setPropertyActionListener value="#{packet}" 
                            target="#{searchPktBean.selectedPacket}" />
                     <f:setPropertyActionListener value="#{packet}" 
                            target="#{personalizeBean.currentPacket}" />
                </p:commandLink>
            </h:panelGrid>
        </p:panel>

	</p:dataGrid>
	
	<p:dialog header="PacketDetail" widgetVar="packetDialog" modal="true">
		<p:outputPanel id="packetDetail" style="text-align:center;">
			
			<h:panelGrid  columns="2" cellpadding="5">
				<h:outputLabel for="pid" value="PID: " />
				<h:outputText id="pid" value="#{searchPktBean.selectedPacket.pid}" />
				
				<h:outputLabel for="destinazione" value="Destinazione: " />
				<h:outputText id="destinazione" value="#{searchPktBean.selectedPacket.destinazione}" />
				
				<h:outputLabel for="dataInizio" value="Data Inizio: " />
				<h:outputText id="dataInizio" value="#{searchPktBean.selectedPacket.dataInizio}" />
				
				<h:outputLabel for="dataFine" value="Data Fine: " />
				<h:outputText id="dataFine" value="#{searchPktBean.selectedPacket.dataFine}" />
				
				<h:link value="Dettagli Volo" outcome="dettagliVolo.xhtml"/>
				<br/>
				<h:link value="Dettagli Hotel" outcome="dettagliHotel.xhtml"/>
				<br/>
				<h:link value="ListaEscursioni" outcome="listaEscursioni.xhtml"/>
				<br/>
				<h:link value="Personalizza Pacchetto(Solo Utenti Registrati))" outcome="user/personalizzazioneVoloAndata.xhtml" />
				<br/>
				<h:link value="Prenota Pacchetto(Solo Utenti Registrati))" outcome="user/prenotazioneRicercato.xhtml" />
				
				
			</h:panelGrid>
		</p:outputPanel>
	</p:dialog>

</h:form>
</h:body>
</f:view>		
</html>